package com.aqiang.day0528_shop.main.adapter

import com.aqiang.day0528_shop.R
import com.aqiang.day0528_shop.main.entity.SearchGoodsEntity
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder

class SearchGoodsAdapter(lay:Int,list:List<SearchGoodsEntity>):BaseQuickAdapter<SearchGoodsEntity,BaseViewHolder>(lay,list) {
    override fun convert(helper: BaseViewHolder?, item: SearchGoodsEntity?) {
        helper!!.setText(R.id.tv_search_goods_name,item?.Title)
        helper!!.setText(R.id.tv_search_goods_price,"￥${item?.ReservePrice}")
        helper!!.setText(R.id.tv_search_goods_address,"${item?.CommissionRate}+好评")
        helper!!.setText(R.id.tv_search_goods_shop,"${item?.ShopTitle}")
        Glide.with(mContext)
            .load(item?.PictUrl)
            .transform(CenterCrop())
            .into(helper.getView(R.id.iv_search_goods_img))
    }
}